package ru.st.selenium.storage;
 
public class StorageFactory {
    private static Storage inMemoryInstance = null;
    private static final Object lock = new Object();
 
    public static <K, V> Storage<K, V> getInMemoryInstance() {
        if (inMemoryInstance == null) {
            synchronized (lock) {
                if (inMemoryInstance == null) {
                    inMemoryInstance = new InMemoryStorage<K, V>();
                }
            }
        }
        return inMemoryInstance;
    }
}